<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'upload.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
   <script type="text/javascript">
   <!--
      function addFile(){
         var t=document.getElementById("uploadtd");
         var input=document.createElement("input");
         var button=document.createElement("input");
         var br=document.createElement("br");
          input.name="upload";
          input.type="file";
          button.name="delete";
          button.type="button";
          button.value="删除";       
         t.appendChild(input);
       
         t.appendChild(button);
         t.appendChild(br);
      }
      function delFile(file){
        var del=file;
        
      }
   //-->
   </script>
  </head>
  
  <body>
   <h1>文件上传</h1>
   
   <s:form action="upload" enctype="multipart/form-data" method="post">
     <table border="1">
    <tr >
        <td id="uploadtd"> <s:file key="upload.file" name="upload"></s:file><s:a href="" onclick="addFile()">添加</s:a></td>
    </tr>
    <tr>
         <TD><s:textfield name="name" key="upload.name"></s:textfield></TD>
     </tr>
     <tr>
         <TD><s:submit key="submit"></s:submit></TD>
     </tr>
    </table>
   </s:form>

  </body>
</html>
